package com.zb.vo;

import com.zb.utils.VerificUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @Author WEN
 * @Date 2023/7/18 0018
 **/
@Data
@ApiModel("修改密码类封装")
public class AccountPasswordVo {
    @NotNull(message = "改密类型不能为空")
    @ApiModelProperty(value = "改密类型：1-验证码，2-旧密码改密", required = true, example = "1")
    private Integer type;

    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = VerificUtil.REGEX_PHONE, message = "手机号格式不正确")
    @ApiModelProperty(value = "手机号", required = true)
    private String phone;

    @NotBlank(message = "验证码或旧密码不能为空")
    @ApiModelProperty(value = "验证码/旧密码", required = true)
    private String oldPassword;

    @NotBlank(message = "新密码不能为空")
//    @Pattern(regexp = VerificUtil.PASSWORD_RULE, message = "新密码格式不正确，请输入不少于六位并包含数字、大小字母、特殊字符的密码")
    @Length(max = 500, message = "账号名称字符长度限制在500个以内")
    @ApiModelProperty(value = "新密码", required = true)
    private String newPassword;

}
